package net.vkits.auth.domain.repository;

import net.vkits.auth.domain.model.User;
import net.vkits.auth.domain.model.UserStatus;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Optional;

/**
 * Created by ethan-liu on 16/3/20.
 */
public interface UserRepository extends JpaRepository<User, Long> {
    Optional<User> findByUsername(String username);
    Optional<User> findByUsernameAndDeletedFalse(String username);
    Optional<User> findByUsernameAndDeletedFalseAndStatus(String username, UserStatus userStatus);
    Page<User> findByDeletedFalse(Pageable pageable);
}
